home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1998 September
/
Macworld (1998-09).dmg
/
Shareware World
/
Info
/
For Developers
/
MacZoop 1.8.3
/
Required Classes
/
Z Headers
/
ZEventHandler.h
< prev
next >
Wrap
Text File
|
1998-05-29
|
2KB
|
83 lines
/*************************************************************************************************
*
*
* MacZoop - "the framework for the rest of us"
*
*
*
* ZEventHandler.h -- the event handler object
*
*
*
*
*
* © 1996, Graham Cox
*
*
*
*
*************************************************************************************************/
#pragma once
#ifndef __ZEVENTHANDLER__
#define __ZEVENTHANDLER__
#include <AppleEvents.h>
class ZWindow;
class ZCommander;
class ZEventHandler
{
protected:
short clicks; // number of mouse-clicks in a series
EventRecord lastEvent; // the event recovered from queue
Boolean inBackground; // TRUE if app in background
char epPPCYokeDown; // how many loops between WaitNextEvent() on PowerMac?
public:
ZEventHandler();
virtual void EstablishCurrentHandler();
virtual void GetAnEvent( EventRecord* theEvent, const short mask = everyEvent );
virtual void DispatchAnEvent( EventRecord* theEvent );
virtual void InstallApplescriptHandlers();
virtual void InstallAppleEventHandler( const AEEventClass pClass, const AEEventID pID );
virtual void HandleWindowUpdate( const WindowPtr theWindow );
virtual void HandleWindowActivate( const WindowPtr theWindow, const Boolean state );
protected:
virtual void CountClicks(const WindowPtr target, const long clickTicks, const Point globalMouse );
virtual void HandleMouseEvent( const EventRecord& theEvent );
virtual void HandleKeyEvent( const char theKey, const Boolean isAutoKey, short modifiers );
virtual void PassIdle();
virtual void HandleHLEvent( const EventRecord& theEvent);
virtual void HandleOSEvent( const EventRecord& theEvent);
virtual Boolean PrefilterDialogEvent( EventRecord* theEvent );
public:
inline short GetClicks(){ return clicks;};
inline Boolean InBackground(){ return inBackground;};
inline void GetLatestEvent( EventRecord* anEvent ) { *anEvent = lastEvent; };
};
extern short gSleep;
extern ZCommander* gCurHandler;
#define kFrontSleep LMGetCaretTime()
#define kBackSleep (kFrontSleep << 2)
// number of loops between calls to WaitNextEvent() on PowerPC:
#define kPowerPCWNEYokeDown 32
#endif